package com.jcl.recruit.core.config.redis;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;
import java.util.concurrent.CountDownLatch;

/*import org.apache.commons.lang.StringEscapeUtils;*/

/**
 * @author 刘明新
 * @date 2018/8/23 下午2:15
 */
public class Receiver {

    private CountDownLatch latch;


    public Receiver(CountDownLatch latch){
        this.latch = latch;
    }

    public void receiveMessage(String message) throws Exception{
        /*message = StringEscapeUtils.unescapeJava(message);*/
        message = message.substring(1,message.length()-1);
        try {
            Map<String,String> map = JSONObject.toJavaObject(JSONObject.parseObject(message),Map.class);
            /*accessCloudClient.accessParams(map);*/
        }catch (Exception e){
            e.printStackTrace();
        }
        latch.countDown();
    }
}
